import {createRouter, createWebHistory} from 'vue-router'


// 本地所有路由
const localRoutes = [
    {
        path: '/login',
        name: 'login',
        component: () => import("@/views/sign/index.vue"),
    },
    {
        path: '/',
        name: 'home',
        component: () => import("@/layouts/index.vue"),
        redirect: "/dashboard",
        meta: {breadcrumb: "首页"},
        children: [
            {
                path: '/dashboard',
                name: 'dashboard',
                component: () => import("@/views/dashboard/index.vue"),
                meta: {breadcrumb: "仪表盘"}
            },
            {
                path: "/system",
                name: "system",
                meta: {breadcrumb: "系统管理"},
                redirect: "/system/user",
                children: [
                    {
                        path: "/system/user",
                        name: "user",
                        component: () => import("@/views/system/user/index.vue"),
                        meta: {breadcrumb: "用户管理"},
                    },
                    {
                        path: "/system/role",
                        name: "role",
                        component: () => import("@/views/system/role/index.vue"),
                        meta: {breadcrumb: "角色管理"},
                    },
                    {
                        path: "/system/menu",
                        name: "menu",
                        component: () => import("@/views/system/menu/index.vue"),
                        meta: {breadcrumb: "菜单管理"},
                    }
                ]
            }
        ]
    },

]


const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: localRoutes
})


export default router;
